﻿using System;
using System.Windows.Forms;
using HighDiveEngine.Aggregates;

namespace HighDiveAdmin.GUI.Components
{
    /// <summary>
    /// Control that handles showing of contest resulsts
    /// </summary>
    public partial class RunningContestResults : UserControl
    {
        public RunningContestResults()
        {
            InitializeComponent();
            TabStop = false;
        }

        /// <summary>
        /// Fills the control with all information about dives and divers
        /// </summary>
        /// <param name="diveList">List ofall the dives in the contest sorted by diver results</param>
        public void FillResultTree(DiveList diveList)
        {
            FormMain.PopulateTreeFromDiveList(treeViewResults, diveList, false);
        }

        private void RunningContestResults_TabStopChanged(object sender, EventArgs e)
        {
            treeViewResults.TabStop = TabStop;
            if (TabStop)
                treeViewResults.Focus();
        }
    }
}
